﻿<UserControl
    x:Class="Srk.BetaseriesApiApp.Views.Login"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
    mc:Ignorable="d" 
    d:DesignHeight="300" d:DesignWidth="300">
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition />
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition Width="Auto" />
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>

        <Label Grid.Row="1" Grid.Column="0" xml:space="preserve" Content="Username: " />
        <TextBox Grid.Row="1" Grid.Column="1" 
                 Text="{Binding Username}"
                 IsEnabled="{Binding IsNotBusy}" />
        <CheckBox Grid.Row="1" Grid.Column="2" IsChecked="{Binding SaveUsername}" Content="Save" />

        <Label Grid.Row="2" Grid.Column="0" xml:space="preserve" Content="Password: "/>
        <PasswordBox Grid.Row="2" Grid.Column="1"
                     x:Name="pwLogin"
                     IsEnabled="{Binding IsNotBusy}" />
        <CheckBox Grid.Row="2" Grid.Column="2" IsChecked="{Binding SavePassword}" Content="Save" />
                    
        <Button Grid.Row="3" Grid.Column="0"
                Click="LoginButton_Click"
                IsEnabled="{Binding CanLoginProp}" Content="Login"/>

        <Button Grid.Row="3" Grid.Column="1"
                Command="{Binding LogoffCommand}" Content="Logout"/>
    </Grid>
</UserControl>
